
	
	$(document).ready(function () {
		
		var po = document.createElement('script'); 
		po.type = 'text/javascript';
		po.async = true;
	    po.src = 'https://apis.google.com/js/client:plusone.js';
	    var s = document.getElementsByTagName('script')[0];
	    s.parentNode.insertBefore(po, s);

	});
	
	
	
	$('#signinButton').click(function signinCallback(authResult) {
	  	  if (authResult['access_token']) {
			  
			    gapi.client.load('oauth2', 'v2', function() {
			    	gapi.client.oauth2.userinfo.get().execute(function(resp){
			    		
			    		document.getElementById('googleEmail').setAttribute('value',resp.email);
			    		document.getElementById('loginForm').submit();
	
			    		
			    	});
		  
		        });	    		  
			  
	
			     		 
			  
		  } else if (authResult['error']) {
		    // There was an error.
		    // Possible error codes:
		    //   "access_denied" - User denied access to your app
		    //   "immediate_failed" - Could not automatically log in the user
		    // console.log('There was an error: ' + authResult['error']);
		  }
		}
			
	
	
	);
	
	
	
